package com.tools.core;

import com.caiyigo.baihua.entity.CjBean;

/**
 * 生成器入口
 * 
 * @author Administrator
 * 
 */
public class GenerateCode {

	/**
	 * 执行生成
	 * 
	 * @param args
	 */
	public static void main(String[] args) {
		// GenerateCode.generateAll();
		GenerateCode.generateAll(CjBean.class);
	}

	/**
	 * 设置生成属性
	 * 
	 * @return
	 */
	public static CodeSet codeSet() {
		CodeSet codeSet = new CodeSet();
		codeSet.setProjectPath("F:\\eclipse\\eclipse-kepler-zh-workspace\\EasyuiGenerator");
		codeSet.setTemplateSource("src.com.tools");
		codeSet.setSourceName("navicat");
		codeSet.setPackageName("charges");
		codeSet.setBasePackageName("com.hk");
		codeSet.setPageSource("WebContent.WEB-INF.page");
		return codeSet;
	}

	/**
	 * 生成
	 * 
	 * @param entity
	 */
	@SuppressWarnings("rawtypes")
	public static void generateAll(Class entity) {
		Base.generateSource(entity, codeSet(), "Dao");
		Base.generateSource(entity, codeSet(), "Service");
		Base.generateSource(entity, codeSet(), "ServiceImpl");
		Base.generateSource(entity, codeSet(), "Action");
		Base.generateSource(entity, codeSet(), "Edit");
		Base.generateSource(entity, codeSet(), "List");

		Base.generateSource(entity, codeSet(), "Detail");

	}

}
